﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ScheduleMaker.DB.Domain.Core;

namespace ScheduleMaker.DB.Domain
{
    public class HourSchool : Hour
    {
        private int id;
        private Day day;
        private TimeSpan begin;
        private TimeSpan end;

        public virtual int Id
        {
            get { return id; }
            set { id = value; }
        }

        public virtual Day Day
        {
            get { return day; }
            set { day = value; }
        }

        public virtual TimeSpan Begin
        {
            get { return begin; }
            set { begin = value; }
        }

        public virtual TimeSpan End
        {
            get { return end; }
            set { end = value; }
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;
            var t = obj as HourSchool;
            if (t == null)
                return false;
            if (Id == t.Id
                && Day.Id == t.Day.Id
                && Begin == t.Begin
                && End == t.End)
                return true;
            return false;
        }

        public override int GetHashCode()
        {
            return (Id + "|"
                + Begin + "|"
                + End).GetHashCode();
        }

    }
}
